Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Author Permalink Structure for Consistency and SEO on 11ty Site #1748

Merged

Conversation

reatlat
Copy link
Contributor

@reatlat reatlat commented Dec 19, 2024

This pull request fixes an issue with the author permalink structure on the 11ty website, caused by differences in case sensitivity between Netlify and Vercel. Netlify handles URLs in a case-tolerant manner, automatically forcing them to lowercase, which ensured that links like

worked seamlessly. However, on Vercel, URLs are case-sensitive, which led to inconsistencies and broken links when author slugs were not uniformly lowercase.

Current https://www.11ty.dev/authors/ page contains all links in lowercase format like this

To resolve this, the author permalink structure has been updated to enforce lowercase formatting using a slug filter. This change ensures all author URLs are consistently lowercase, preventing broken links and ensuring proper routing on Vercel’s deployment environment.

By standardizing URLs, this update enhances both user experience and SEO, ensuring predictable, functional, and clean author page links across the site.

Updated the author permalink structure to use a slug filter, ensuring URLs are consistently formatted and SEO-friendly. This helps prevent potential issues with special characters or spaces in author names.
@Snapstromegon
Copy link
Member

The described issue is correct and IMO this is also the right change, but just to make this sure, I'm looping in @zachleat.

Either way: Thanks @reatlat for bringing this up and also providing a fix.

@reatlat
Copy link
Contributor Author

reatlat commented Dec 19, 2024

Another optimal solution is edit vercel.config to something like

{
  "rewrites": [
    {
      "source": "/:path*",
      "destination": "/:path*",
      "has": [
        {
          "type": "header",
          "key": "x-original-url",
          "value": "/.*[A-Z]+.*/"
        }
      ]
    }
  ],
  "redirects": [
    {
      "source": "/(.*[A-Z].*)",
      "destination": "/$1",
      "statusCode": 301
    }
  ]
}

@reatlat
Copy link
Contributor Author

reatlat commented Jan 2, 2025

@zachleat any thoughts about rewrite rules on vercel? or just unify links?

@zachleat
Copy link
Member

zachleat commented Jan 2, 2025

I think this will probably result in a few broken links for folks if they are already linking to their existing author page—so which is worse:

  • broken link from the authors page
  • broken link from the world wide web

I think the latter is worse, maybe we merge this and also one-off hardcode some redirects for slugs that were broken?

My 2025 energy is also also kind of on-board with just merging this as-is 😅

@zachleat zachleat merged commit 55a3f81 into 11ty:main Jan 2, 2025
1 check passed
@zachleat
Copy link
Member

zachleat commented Jan 2, 2025

Let’s go for it.

@reatlat reatlat deleted the fix-authors-permalinks-for-vercel-hosting branch January 2, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants